﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke;
using DotNetNuke.Entities.Modules;
using DataAccessLayer;
namespace DNNNHibernate
{
    public partial class Customers : PortalModuleBase
    {
        DataAccessLayer.NHibernateDataProvider provider = new DataAccessLayer.NHibernateDataProvider();
        protected void Page_Load(object sender, EventArgs e)
        {
            grdCustomers.DataSource = provider.GetAllCustomers();
            grdCustomers.DataBind();    
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {

            DataTransfer.Customer customer = new DataTransfer.Customer();
            customer.FirstName = txtFirstName.Text;
            customer.LastName = txtLastName.Text;
            provider.AddCustomer(customer);
        }

       
    }
}